<?php

/**
 * @Author: wuchenge
 * @Date: 2020-12-08 14:55:31
 * @email: ligui0506@sina.com
 * @descript: 权限节点初始化数据
 */

use App\Models\Rbac\Node;
use Illuminate\Database\Seeder;

class NodesTableSeeder extends Seeder
{
    public function run()
    {
        $data = [
            [
                'name'  => 'admin.rbac',
                'title' => '权限管理',
                'pid'   => 0,
            ],
            [
                'name'  => 'admin.rbac.node',
                'title' => '节点列表',
                'pid'   => 1,
            ],
            [
                'name'  => 'admin.rbac.role',
                'title' => '角色列表',
                'pid'   => 1,
            ],
            [
                'name'  => 'admin.rbac.admin',
                'title' => '管理员列表',
                'pid'   => 1,
            ],
        ];
        foreach ($data as $value) {
            Node::create($value);
        }
    }
}
